So just to illustrate, the usual mechanism to get this working would look like this:
use Asterisk::AGI;
my $agi = new Asterisk::AGI;
$agi->setcallback(&hangup);
my %input = $agi->ReadParse();
sub hangcallback{
# do something in here
exit 0;
}
Since this appears to have stopped working, the only other way to achieve this is by writing a custom signal handler so that your perl script traps the HUP signal and does something useful before dying. This would be done in this way:
use Asterisk::AGI;
my $agi = new Asterisk::AGI;
$SIG{HUP} = sub {
# do something useful
exit(0);
};
my %input = $agi->ReadParse();
Using this mechanism, you can mimic the functionality provided by the AGI setcallback method in your agi scripts.
I hope this saves somebody some hours, because I just wasted an eon trying to debug this crap.
christo